using System;
using System.IO;

namespace AnalyticIntegration.batch
{
    internal interface ILineGetter
    {
        string ReadLine();
    }

    class FileReadLine : ILineGetter
    {
        private readonly string[] m_Text;
        private int m_Positon = 0;

        public FileReadLine(string filename)
        {
            m_Text = File.ReadAllLines(filename);
        }

        public string ReadLine()
        {
            if (m_Positon >= m_Text.Length)
            {
                return null;
            }
            return m_Text[m_Positon++];
        }
    }

    class ConsoleReadLine : ILineGetter
    {
        public string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

